import Vue from "vue";
import "./style.css";
import App from "./App.vue";
import pinia from "./stores";
import { PiniaVuePlugin } from "pinia";
import router from "./router";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import "virtual:svg-icons-register";
// import SvgIcon from "@/components/SvgIcon/Index.vue";
import directive from "@/directive/index";
// import { juadgeWebGL } from "./utils/juadge";
import { handleTree } from "./utils/cmsNeed";
// svg图标
import "virtual:svg-icons-register";
import SvgIcon from "@/components/SvgIcon/RuoyiIcon3.vue";

import mircoApp from "@micro-zoe/micro-app";

// import { useDict } from "./hooks/useDict"; // 类型不好设置
// import "babel-polyfill";
// import { createApp } from "vue-demi";

// console.log("环境变量126", import.meta.env);
// juadgeWebGL();
Vue.use(PiniaVuePlugin).use(ElementUI).use(directive);
Vue.component("svg-icon", SvgIcon);
Vue.config.productionTip = false;
// 全局方法挂载
// Vue.prototype.useDict = useDict; // 字典方法
// app.config.globalProperties.useDict = useDict //vue3.0 全局方法挂载
Vue.prototype.handleTree = handleTree;
const app = new Vue({
  router,
  pinia,
  render: (h: any) => h(App),
} as any);
app.$mount("#app");

console.log("路由", router, import.meta.env);
// const app = createApp(App).use(router).mount("#app");
// 启用微前端
mircoApp.start();
